package com.yuwenxin.bean;

import java.lang.reflect.Field;

public class SuperUser extends User {

    public static void main(String[] args) throws ClassNotFoundException {
        SuperUser superUser = new SuperUser();

        superUser.setName("xxx");
        System.out.println(superUser.getName());

        Class cls = Class.forName("com.yuwenxin.bean.SuperUser");
        Field[] fields = cls.getDeclaredFields();

        for (Field f :
                fields) {
            f.setAccessible(true);
        }

        for (Field f :
                fields) {
            int i = 1;
            String field = f.toString();
            System.out.println("SuperUser fileds:" + i++ + field);
        }
    }

}
